package com.atguigu.gmall.seckill.service;

import com.atguigu.gmall.model.activity.SeckillGoods;
import com.atguigu.gmall.seckill.pojo.SeckillOrder;
import com.atguigu.gmall.seckill.pojo.UserRecode;

import java.util.List;

/**
 * @Author: dongdong lau
 * @CreateTime: 2021/7/15 10:24
 * @Description: 秒杀微服务接口类
 */
public interface SeckillService {

    /**
     * 根据时间查询时间所在时间段内所有秒杀商品
     * @param time
     * @return
     */
    public List<SeckillGoods> findAll(String time);

    /**
     * 根据时间和商品Id查询商品详情
     * @param time
     * @param id
     * @return
     */
    public SeckillGoods getSeckillGoods(String time,String id);

    /**
     * 用户排队下单
     * @return
     */
    public UserRecode addOrder(String time, String skuId, String userId);

    /**
     * 根据用户id查询排队状态
     * @param userId
     * @return
     */
    public UserRecode getUserRecode(String userId);

    /**
     * 获取秒杀订单
     * @param username
     * @param orderId
     * @return
     */
    public List<SeckillOrder> getSeckillOrder(String username, String orderId);
}
